import request from '@/utils/request'
import apiArr from '@/kaowu_api'

export function roomList(params) {
  return request({
    url: apiArr.roomList,
    method: 'get',
    params
  })
}
export function roomAdd(data) {
  return request({
    url: apiArr.roomAdd,
    method: 'post',
    data
  })
}
export function roomEdit(params, method = 'post') {
  if (method == 'post') {
    return request({
      url: apiArr.roomEdit,
      method,
      data: params
    })
  } else {
    return request({
      url: apiArr.roomEdit,
      method,
      params
    })
  }
}
export function roomDelete(data) {
  return request({
    url: apiArr.roomDelete,
    method: 'post',
    data
  })
}
export function roomModifyState(data) {
  return request({
    url: apiArr.roomModifyState,
    method: 'post',
    data
  })
}
